import { Component, OnInit, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core';

@Component({
  selector: 'app-task-header',
  templateUrl: './task-header.component.html',
  styleUrls: ['./task-header.component.scss'],
  //ChangeDetectionStrategy.OnPush 不用检查当前组件树是否变化  除非 你告诉我  手动设置
  changeDetection:ChangeDetectionStrategy.OnPush
})
export class TaskHeaderComponent implements OnInit {
  @Input() header = '';

  //新建任务 发射出去的事件
  @Output() newTask= new EventEmitter<void>();
  @Output() moveAll= new EventEmitter<void>();
  @Output() deleteListItem = new EventEmitter<void>();
  @Output() eidetListName = new EventEmitter<void>();

  constructor() { }

  ngOnInit() {
  }
  onNewTaskClick(){
    this.newTask.emit();
  }
  onMoveAllClick(){
    this.moveAll.emit();
  }
  onDeleteListItemClick(){
    this.deleteListItem.emit();
  }
  onEidetListClick(){
    this.eidetListName.emit();
  }

}
